#ifndef __MYOPENCV_H
#define __MYOPENCV_H
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <linux/videodev2.h>
using namespace std;
using namespace cv;
class OPENCV{
    private:
        bool m_run = false;
        pthread_t m_thread;
        bool m_mouseclick = false;
    protected:
    public:
        Mat m_mat;
        Point *pre_pt;
        Point *cur_pt;
        string m_windowname = "camvideo";
        VideoCapture *m_capture;
    private:
    protected:
    public:
        void drawrevtangle();
        int imgshow(String imgName);
        void update(uint8_t *data);
        bool isrunning();
        int start();
        int stop();
        OPENCV();
        ~OPENCV();
};

void mouseclick(int event,int x,int y,int flags,void* param);
static void* opencv_handle_pthread(void *ptr);
#endif
